//
//  WGUserDefaultTool.m
//  WisdomGardon
//
//  Created by 郭壮 on 16/8/24.
//  Copyright © 2016年 Red Persimmon. All rights reserved.
//

#import "WGUserDefaultTool.h"
#import "WGAccountTool.h"

@implementation WGUserDefaultTool

+(void)init{
    [self saveUserDetault:@"" key:kUserId];
    [self saveUserDetault:@"" key:kToken];
    [self saveUserDetault:@"" key:kHeadImage];
    [self saveUserDetault:@"" key:kName];
    [self saveUserDetault:@"" key:kTitle];
    [self saveUserDetault:@"" key:kCompany];
    [self saveUserDetault:@"" key:kSex];
    [self saveUserDetault:@"" key:kTel];
}

+(void)saveUserDetault:(id)object key:(NSString *)key{
    [[NSUserDefaults standardUserDefaults] setValue:object forKey:key];
    [[WGAccountTool sharedInstance] setValue:object forKey:key];
}

+(id)getUserDetault:(NSString *)key {
    return [NSString stringWithFormat:@"%@",[[NSUserDefaults standardUserDefaults] objectForKey:key]];
}

+(NSDictionary *)getUserDetaultDictionary:(NSString *)key{
    return [[NSUserDefaults standardUserDefaults] objectForKey:key];
}

+(NSMutableArray *)getUserDetaultArray:(NSString *)key{
    return [[NSUserDefaults standardUserDefaults] objectForKey:key];
}

+(NSDate *)getUserDetaultDate:(NSString *)key{
    return [[NSUserDefaults standardUserDefaults] objectForKey:key];
}

@end
